import vue from '@vitejs/plugin-vue';
import createAutoImport from './auto-import';
import path from 'path';
import vueJsx from "@vitejs/plugin-vue-jsx"
import { createSvgIconsPlugin } from "vite-plugin-svg-icons"
import svgLoader from "vite-svg-loader"
import UnoCSS from "unocss/vite"
import createComponents from './components';
export default (viteEnv: any, isBuild = false): [] => {
    const vitePlugins: any = [];
    vitePlugins.push(vue());
    vitePlugins.push(UnoCSS());
    vitePlugins.push(vueJsx());
    vitePlugins.push(createAutoImport(path));
    vitePlugins.push(createComponents(path));
    vitePlugins.push(svgLoader({ defaultImport: "url" }));
    vitePlugins.push(createSvgIconsPlugin({
        iconDirs: [path.resolve(process.cwd(), "src/icons/svg")],
        symbolId: "icon-[dir]-[name]"
    }),);
    return vitePlugins;
};
